package com.delicious.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.delicious.dao.impl.FoodsDaoImpl;
import com.delicious.dao.impl.NewsDaoImpl;
import com.delicious.entity.Foods;
import com.delicious.entity.News;

public class IndexServlet extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		List<Foods> foodsList = new FoodsDaoImpl().getFoodsByPaging(1, 3);
		List<News> newsList = new NewsDaoImpl().getNewsPaging(1, 6);
		
		request.setAttribute("news", newsList);
		request.setAttribute("foods", foodsList);
		
		request.getRequestDispatcher("index.jsp").forward(request, response);

	}

}
